<section style="overflow-y: scroll;" class="Hui-article-box">
    <div class="panel panel-default">
	<div class="panel-header">签到人员列表</div>
        <div class="panel-body">
            <form style="margin:10px 0;" class="text-l"> 
                会议：
                
                     
                <span class="select-box">
                <select name="meeting_id" class="select" size="1"  >
                    <option value="">请选择会议</option>
                    {foreach $meetinglist as $vo} 
                        <option {if input('meeting_id')==$vo['id']}selected{/if} value="{$vo.id}">{$vo.meeting_name}</option>
                    {/foreach}
                </select>
                </span>
                <br/> <br/>
                姓名：<input type="text" value="<?php echo input('name');?>" placeholder="输入姓名"  name="name" class="input-text" style="width:250px" >
                手机号：<input type="text" value="<?php echo input('phone');?>" placeholder="输入手机号"  name="phone" class="input-text" style="width:250px" >
                身份证：<input type="text" value="<?php echo input('idcard');?>" placeholder="输入身份证"  name="idcard" class="input-text" style="width:250px" >
                <br/><br/>
                <button type="submit" class="btn btn-success radius" name=""><i class="Hui-iconfont"></i> 搜索</button>
                <a href="javascript:location.reload()" class="btn btn-danger radius" id="" name="">清空查询</a>
            </form>
            <article class="cl">
                <table class="table table-border table-bordered table-bg">
                    <thead>
                        <tr>
                            <th scope="col" colspan="9">列表</th>
                        </tr>
                        <tr class="text-c">
                            <th width="40">编号</th>
                            <th width="40">所属会议</th>
                            <th width="90">头像</th>
                            <th width="90">身份证</th>
                            <th width="90">用户信息</th>
                            <th width="90">签到信息</th>
                            <th width="100">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($datalist as $k=>$v){ ?>
                        <tr class="text-c">
                            <td>{$v['id']}</td>
                            <td>{$v['meeting']['meeting_name']}</td>
                            <td><img class="pimg" width="200" height="100"   style="border: 1px solid #eee; border-radius: 10px;" src="<?=$v['headimg']?>"/></td>
                            <td><img class="pimg" width="200"  height="100" style="border: 1px solid #eee; border-radius: 10px;" src="<?=$v['idcardimg']?>"/></td>
                            <td>
                                姓名：<?=$v['name']?><br/>
                                手机号：<?=$v['phone']?><br/>
                                身份证：<?=$v['idcard']?><br/>
                            </td>
                            <td>
                                报名时间：<?=$v['create_time']?><br/>
                                {if $v['status']==1}
                                已签到（{$v['sign_time']}）
                                {else}
                                未签到
                                {/if}
                            </td>
                            <td>
                                <!-- <a onclick="layer_show('编辑', '/admin/sign/add?id={$v["id"]}')" 
                                    class="ml-5 btn radius btn-primary">
                                     <i class="Hui-iconfont">&#xe6df;</i>编辑
                                 </a>  -->
                                 <a onclick="del(this, '{$v['id']}')" class="btn radius btn-danger">
                                     <i class="Hui-iconfont">&#xe6e2;</i>删除
                                 </a>
                            </td>
                        </tr>
                        <?php } ?>
                    </tbody>
                </table>
                <div><?php echo $pager;?></div>
            </article>
        </div>
    </div>
    <div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
        <div id="innerdiv" style="position:absolute;">
            <img id="bigimg" style="border:5px solid #fff;" src="" />
        </div>
    </div>  
</section>
<script type="text/javascript" src="/static/lib/laypage/1.2/laypage.js"></script> 
<script type="text/javascript">
function del(obj,id){
    layer.confirm('确认要删除吗？',function(index){
        $.get('/admin/sign/del?id='+id).then(function(res){
            if(res.code==0) {
                layer.msg(res.msg,{icon:1,time:1000});
                $(obj).parents("tr").remove();
            }else{
                layer.msg(res.msg);
            }
        })
    });
}
function imgShow(outerdiv, innerdiv, bigimg, _this){  
        var src = _this.attr("src");//获取当前点击的pimg元素中的src属性  
        $(bigimg).attr("src", src);//设置#bigimg元素的src属性  
      
            /*获取当前点击图片的真实大小，并显示弹出层及大图*/  
        $("<img/>").attr("src", src).load(function(){  
            var windowW = $(window).width();//获取当前窗口宽度  
            var windowH = $(window).height();//获取当前窗口高度  
            var realWidth = this.width;//获取图片真实宽度  
            var realHeight = this.height;//获取图片真实高度  
            var imgWidth, imgHeight;  
            //缩放尺寸，当图片真实宽度和高度大于窗口宽度和高度时进行缩放  
            var scale = 0.8;
            //判断图片高度    
            if(realHeight>windowH*scale) {
            //如大于窗口高度，图片高度进行缩放  
                imgHeight = windowH*scale;
                //等比例缩放宽度 
                imgWidth = imgHeight/realHeight*realWidth;
                //如宽度扔大于窗口宽度   
                if(imgWidth>windowW*scale) {
                    //再对宽度进行缩放 
                    imgWidth = windowW*scale; 
                }  
            //如图片高度合适，判断图片宽度  
            } else if(realWidth>windowW*scale) {
            //如大于窗口宽度，图片宽度进行缩放  
                imgWidth = windowW*scale;
                //等比例缩放高度  
                imgHeight = imgWidth/realWidth*realHeight;
            } else {
                imgWidth = realWidth;  
                imgHeight = realHeight;  
            }  
            //以最终的宽度对图片缩放  
            $(bigimg).css("width",imgWidth);
            //计算图片与窗口左边距    
            var w = (windowW-imgWidth)/2;
            //计算图片与窗口上边距  
            var h = (windowH-imgHeight)/2;
            //设置#innerdiv的top和left属性  
            $(innerdiv).css({"top":h, "left":w});
            //淡入显示#outerdiv及.pimg  
            $(outerdiv).fadeIn("fast");
        });  
         //再次点击淡出消失弹出层   
        $(outerdiv).click(function(){
            $(this).fadeOut("fast");  
        });  
    }  
$(function() {
    $(".pimg").click(function(){  
            var _this = $(this);//将当前的pimg元素作为_this传入函数  
            imgShow("#outerdiv", "#innerdiv", "#bigimg", _this);  
    });  
})

</script> 
